# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-tabview
pkgver=1.4.4
pkgrel=3
pkgdesc="A curses command-line CSV and list (tabular data) viewer"
url="https://github.com/TabViewer/tabview"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('expect')
source=("https://github.com/TabViewer/tabview/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('8ce8957d209f9bdf447341523ca457bc878f7195536a8e8a1259999bfa00571ce62bda617001e49cf31fade1c106a8e34647c9d7f9dc25be38b0cf6832ed136f')

build() {
  cd tabview-$pkgver
  python setup.py build
}

check() {
  cd tabview-$pkgver
  unbuffer python -m unittest discover
}

package() {
  cd tabview-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}
